home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / bstfiles.zoo / agsm.bst < prev    next >
Text File  |  1992-03-02  |  23KB  |  1,227 lines

  1. % BibTeX standard bibliography style `agsm' (one of the harvard family)
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1991, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
  8.         % dcu.bst or kluwer.bst.
  9.     % This restriction helps ensure that all standard styles are identical.
  10.     % The file harvard.tex has the documentation for this style.
  11.  
  12. % ACKNOWLEDGEMENT:
  13. %   This document is a modified version of alpha.bst to which it owes much of
  14. %   its functionality.
  15.  
  16. % AUTHOR
  17. %   Peter Williams, Key Centre for Design Quality, Sydney University
  18. %   e-mail: peterw@archsci.arch.su.oz.au
  19.  
  20. ENTRY
  21.   { address
  22.     author
  23.     booktitle
  24.     chapter
  25.     edition
  26.     editor
  27.     howpublished
  28.     institution
  29.     journal
  30.     key
  31.     month
  32.     note
  33.     number
  34.     organization
  35.     pages
  36.     publisher
  37.     school
  38.     series
  39.     title
  40.     type
  41.     volume
  42.     year
  43.   }
  44.   { field.used }
  45.   { extra.label sort.label list.year }
  46.  
  47. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  48.  
  49. FUNCTION {init.state.consts}
  50. { #0 'before.all :=
  51.   #1 'mid.sentence :=
  52.   #2 'after.sentence :=
  53.   #3 'after.block :=
  54. }
  55.  
  56. STRINGS { s t f }
  57.  
  58. FUNCTION {output.nonnull}
  59. { 's :=
  60.   output.state mid.sentence =
  61.     { ", " * write$ }
  62.     { output.state after.block =
  63.     { add.period$ write$
  64.       newline$
  65.       "\newblock " write$
  66.     }
  67.     { output.state before.all =
  68.         'write$
  69.         { add.period$ " " * write$ }
  70.       if$
  71.     }
  72.       if$
  73.       mid.sentence 'output.state :=
  74.     }
  75.   if$
  76.   s
  77. }
  78.  
  79. FUNCTION {output}
  80. { duplicate$ empty$
  81.     'pop$
  82.     'output.nonnull
  83.   if$
  84. }
  85.  
  86. FUNCTION {output.check}
  87. { 't :=
  88.   duplicate$ empty$
  89.     { pop$ "empty " t * " in " * cite$ * warning$ }
  90.     'output.nonnull
  91.   if$
  92. }
  93.  
  94. FUNCTION {item.check}
  95. { 't :=
  96.   empty$
  97.     { "empty " t * " in " * cite$ * warning$ }
  98.     { skip$ }
  99.   if$
  100. }
  101.  
  102. FUNCTION {fin.entry}
  103. { add.period$
  104.   write$
  105.   newline$
  106. }
  107.  
  108. FUNCTION {new.block}
  109. { output.state before.all =
  110.     'skip$
  111.     { after.block 'output.state := }
  112.   if$
  113. }
  114.  
  115. FUNCTION {not}
  116. {   { #0 }
  117.     { #1 }
  118.   if$
  119. }
  120.  
  121. FUNCTION {and}
  122. {   'skip$
  123.     { pop$ #0 }
  124.   if$
  125. }
  126.  
  127. FUNCTION {or}
  128. {   { pop$ #1 }
  129.     'skip$
  130.   if$
  131. }
  132.  
  133. FUNCTION {field.or.null}
  134. { duplicate$ empty$
  135.     { pop$ "" }
  136.     'skip$
  137.   if$
  138. }
  139.  
  140. FUNCTION {emphasize}
  141. { duplicate$ empty$
  142.     { pop$ "" }
  143.     { "{\em " swap$ * "}" * }
  144.   if$
  145. }
  146.  
  147. FUNCTION {embolden}
  148. { duplicate$ empty$
  149.     { pop$ "" }
  150.     { "{\bf " swap$ * "}" * }
  151.   if$
  152. }
  153.  
  154. FUNCTION {quote}
  155. { duplicate$ empty$
  156.     { pop$ "" }
  157.     { "`" swap$ * "'" * }
  158.   if$
  159. }
  160.  
  161. INTEGERS { nameptr namesleft numnames }
  162.  
  163. FUNCTION {format.names}
  164. { 's :=
  165.   'f :=
  166.   #1 'nameptr :=
  167.   s num.names$ 'numnames :=
  168.   numnames 'namesleft :=
  169.     { namesleft #0 > }
  170.     { s nameptr f format.name$ 't :=
  171.       nameptr #1 >
  172.     { namesleft #1 >
  173.         { ", " * t * }
  174.         { t "others" =
  175.         { " et~al." * }
  176.         { " \& " * t * }
  177.           if$
  178.         }
  179.       if$
  180.     }
  181.     't
  182.       if$
  183.       nameptr #1 + 'nameptr :=
  184.       namesleft #1 - 'namesleft :=
  185.     }
  186.   while$
  187. }
  188.  
  189. FUNCTION {format.authors}
  190. { author empty$
  191.     { "" }
  192.     { "{vv~}{ll}{, jj}{, f.}" author format.names }
  193.   if$
  194. }
  195.  
  196. FUNCTION {format.editors}
  197. { editor empty$
  198.     { "" }
  199.     { "{vv~}{ll}{, jj}{, f.}" editor format.names
  200.       editor num.names$ #1 >
  201.     { ", eds" * }
  202.     { ", ed." * }
  203.       if$
  204.     }
  205.   if$
  206. }
  207.  
  208. FUNCTION {format.editors.reverse}
  209. { editor empty$
  210.     { "" }
  211.     { "{f.~}{vv~}{ll}{, jj}" editor format.names
  212.       editor num.names$ #1 >
  213.     { ", eds" * }
  214.     { ", ed." * }
  215.       if$
  216.     }
  217.   if$
  218. }
  219.  
  220. FUNCTION {format.title}
  221. { title empty$
  222.     { "" }
  223.     { title "t" change.case$ }
  224.   if$
  225. }
  226.  
  227. FUNCTION {n.dashify}
  228. { 't :=
  229.   ""
  230.     { t empty$ not }
  231.     { t #1 #1 substring$ "-" =
  232.     { t #1 #2 substring$ "--" = not
  233.         { "--" *
  234.           t #2 global.max$ substring$ 't :=
  235.         }
  236.         {   { t #1 #1 substring$ "-" = }
  237.         { "-" *
  238.           t #2 global.max$ substring$ 't :=
  239.         }
  240.           while$
  241.         }
  242.       if$
  243.     }
  244.     { t #1 #1 substring$ *
  245.       t #2 global.max$ substring$ 't :=
  246.     }
  247.       if$
  248.     }
  249.   while$
  250. }
  251.  
  252. FUNCTION {format.btitle}
  253. { title emphasize
  254. }
  255.  
  256. FUNCTION {tie.or.space.connect}
  257. { duplicate$ text.length$ #3 <
  258.     { "~" }
  259.     { " " }
  260.   if$
  261.   swap$ * *
  262. }
  263.  
  264. FUNCTION {either.or.check}
  265. { empty$
  266.     'pop$
  267.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  268.   if$
  269. }
  270.  
  271. FUNCTION {format.bvolume}
  272. { volume empty$
  273.     { "" }
  274.     { "Vol." volume tie.or.space.connect
  275.       series empty$
  276.     'skip$
  277.     { " of " * series emphasize * }
  278.       if$
  279.       "volume and number" number either.or.check
  280.     }
  281.   if$
  282. }
  283.  
  284. FUNCTION {format.number.series}
  285. { volume empty$
  286.     { number empty$
  287.     { series field.or.null }
  288.     { output.state mid.sentence =
  289.         { "number" }
  290.         { "Number" }
  291.       if$
  292.       number tie.or.space.connect
  293.       series empty$
  294.         { "there's a number but no series in " cite$ * warning$ }
  295.         { " {\em in} " * series quote * }
  296.       if$
  297.     }
  298.       if$
  299.     }
  300.     { "" }
  301.   if$
  302. }
  303.  
  304. FUNCTION {format.edition}
  305. { edition empty$
  306.     { "" }
  307.     { output.state mid.sentence =
  308.     { edition "l" change.case$ " edn" * }
  309.     { edition "t" change.case$ " edn" * }
  310.       if$
  311.     }
  312.   if$
  313. }
  314.  
  315. INTEGERS { multiresult }
  316.  
  317. FUNCTION {multi.page.check}
  318. { 't :=
  319.   #0 'multiresult :=
  320.     { multiresult not
  321.       t empty$ not
  322.       and
  323.     }
  324.     { t #1 #1 substring$
  325.       duplicate$ "-" =
  326.       swap$ duplicate$ "," =
  327.       swap$ "+" =
  328.       or or
  329.     { #1 'multiresult := }
  330.     { t #2 global.max$ substring$ 't := }
  331.       if$
  332.     }
  333.   while$
  334.   multiresult
  335. }
  336.  
  337. FUNCTION {format.pages}
  338. { pages empty$
  339.     { "" }
  340.     { pages multi.page.check
  341.     { "pp.~" pages n.dashify * }
  342.     { "p.~" pages * }
  343.       if$
  344.     }
  345.   if$
  346. }
  347.  
  348. FUNCTION {format.vol.num.pages}
  349. { volume embolden field.or.null
  350.   number empty$
  351.     'skip$
  352.     { "(" number * ")" * *
  353.       volume empty$
  354.     { "there's a number but no volume in " cite$ * warning$ }
  355.     'skip$
  356.       if$
  357.     }
  358.   if$
  359.   pages empty$
  360.     'skip$
  361.     { duplicate$ empty$
  362.     { pop$ format.pages }
  363.     { ",~" * pages n.dashify * }
  364.       if$
  365.     }
  366.   if$
  367. }
  368.  
  369. FUNCTION {format.chapter.pages}
  370. { chapter empty$
  371.     'format.pages
  372.     { type empty$
  373.     { "chapter" }
  374.     { type "l" change.case$ }
  375.       if$
  376.       chapter tie.or.space.connect
  377.       pages empty$
  378.     'skip$
  379.     { ", " * format.pages * }
  380.       if$
  381.     }
  382.   if$
  383. }
  384.  
  385. FUNCTION {format.in.ed.booktitle}
  386. { booktitle empty$
  387.     { "" }
  388.     { editor empty$
  389.     { "{\em in} " booktitle quote * }
  390.     { "{\em in} " format.editors.reverse * ", " * booktitle quote * }
  391.       if$
  392.     }
  393.   if$
  394. }
  395.  
  396. FUNCTION {empty.misc.check}
  397. { author empty$ title empty$ howpublished empty$
  398.   month empty$ year empty$ note empty$
  399.   and and and and and
  400.   key empty$ not and
  401.     { "all relevant fields are empty in " cite$ * warning$ }
  402.     'skip$
  403.   if$
  404. }
  405.  
  406. FUNCTION {format.thesis.type}
  407. { type empty$
  408.     'skip$
  409.     { pop$
  410.       type "t" change.case$
  411.     }
  412.   if$
  413. }
  414.  
  415. FUNCTION {format.tr.number}
  416. { type empty$
  417.     { "Technical Report" }
  418.     'type
  419.   if$
  420.   number empty$
  421.     { "t" change.case$ }
  422.     { number tie.or.space.connect }
  423.   if$
  424. }
  425.  
  426. FUNCTION {format.article.crossref}
  427. { key empty$
  428.     { journal empty$
  429.     { "need key or journal for " cite$ * " to crossref " * crossref *
  430.       warning$
  431.       ""
  432.     }
  433.     { "in {\em " journal * "\/} \cite{" * crossref * "}" *}
  434.       if$
  435.     }
  436.     { "{\em in} \citeasnoun{" crossref * "}" * }
  437.   if$
  438.  
  439. }
  440.  
  441. FUNCTION {format.book.crossref}
  442. { volume empty$
  443.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  444.       "in "
  445.     }
  446.     { "Vol." volume tie.or.space.connect
  447.       " of " *
  448.     }
  449.   if$
  450.   editor empty$
  451.   editor field.or.null author field.or.null =
  452.   or
  453.     { key empty$
  454.     { series empty$
  455.         { "need editor, key, or series for " cite$ * " to crossref " *
  456.           crossref * warning$
  457.           "" *
  458.         }
  459.         { "{\em " * series * "\/} \cite{" * crossref * "}" *}
  460.       if$
  461.     }
  462.     { " \citeasnoun{" * crossref * "}" * }
  463.       if$
  464.     }
  465.     { " \citeasnoun{" * crossref * "}" * }
  466.   if$
  467. }
  468.  
  469. FUNCTION {format.incoll.inproc.crossref}
  470. { editor empty$
  471.   editor field.or.null author field.or.null =
  472.   or
  473.     { key empty$
  474.     { booktitle empty$
  475.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  476.           crossref * warning$
  477.           ""
  478.         }
  479.         { "in {\em " booktitle * "\/}" * " \cite{" * crossref * "}" *}
  480.       if$
  481.     }
  482.     { "{\em in} \citeasnoun{" crossref * "}" * }
  483.       if$
  484.     }
  485.     { "{\em in} \citeasnoun{" crossref * "}" * }
  486.   if$
  487.   
  488. }
  489.  
  490. INTEGERS { len }
  491.  
  492. FUNCTION {chop.word}
  493. { 's :=
  494.   'len :=
  495.   s #1 len substring$ =
  496.     { s len #1 + global.max$ substring$ }
  497.     's
  498.   if$
  499. }
  500.  
  501. FUNCTION {format.lab.names.abbr}
  502. { 's :=
  503.   s num.names$ 'numnames :=
  504.   numnames #1 >
  505.     { numnames #2 >
  506.     { s #1 "{vv~}{ll}" format.name$ " et al." * }
  507.     { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  508.             { s #1 "{vv~}{ll}" format.name$ " et al." * }
  509.         { s #1 "{vv~}{ll}" format.name$ " \& " *
  510.               s #2 "{vv~}{ll}" format.name$ * 
  511.             }
  512.           if$
  513.         }
  514.       if$
  515.     }
  516.     { s #1 "{vv~}{ll}" format.name$ }
  517.   if$
  518. }
  519.  
  520. FUNCTION {format.lab.names.full}
  521. { 's :=
  522.   #1 'nameptr :=
  523.   s num.names$ 'numnames :=
  524.   numnames 'namesleft :=
  525.     { namesleft #0 > }
  526.     { s nameptr "{vv~}{ll}" format.name$ 't :=
  527.       nameptr #1 >
  528.     { namesleft #1 >
  529.         { ", " * t * }
  530.         { t "others" =
  531.         { " et~al." * }
  532.         { " \& " * t * }
  533.           if$
  534.         }
  535.       if$
  536.     }
  537.     't
  538.       if$
  539.       nameptr #1 + 'nameptr :=
  540.       namesleft #1 - 'namesleft :=
  541.     }
  542.   while$
  543. }
  544.  
  545. INTEGERS { author.field editor.field organization.field title.field key.field }
  546.  
  547. FUNCTION {init.field.constants}
  548. { #0 'author.field :=
  549.   #1 'editor.field :=
  550.   #2 'organization.field :=
  551.   #3 'title.field :=
  552.   #4 'key.field :=
  553. }
  554.  
  555. FUNCTION {make.list.label}
  556. { author.field field.used =
  557.     { format.authors }
  558.     { editor.field field.used =
  559.         { format.editors }
  560.         { organization.field field.used =
  561.             { "The " #4 organization chop.word #3 text.prefix$ }
  562.             { title.field field.used =
  563.                 { format.btitle }
  564.                 { key.field field.used =
  565.                     { key #3 text.prefix$ }
  566.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  567.                   if$
  568.                 }
  569.               if$
  570.             }
  571.           if$
  572.         }
  573.       if$
  574.     }
  575.   if$
  576. }
  577.  
  578. FUNCTION {make.full.label}
  579. { author.field field.used =
  580.     { author format.lab.names.full }
  581.     { editor.field field.used =
  582.         { editor format.lab.names.full }
  583.         { organization.field field.used =
  584.             { "The " #4 organization chop.word #3 text.prefix$ }
  585.             { title.field field.used =
  586.                 { format.btitle }
  587.                 { key.field field.used =
  588.                     { key #3 text.prefix$ }
  589.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  590.                   if$
  591.                 }
  592.               if$
  593.             }
  594.           if$
  595.         }
  596.       if$
  597.     }
  598.   if$
  599. }
  600.  
  601. FUNCTION {make.abbr.label}
  602. { author.field field.used =
  603.     { author format.lab.names.abbr }
  604.     { editor.field field.used =
  605.         { editor format.lab.names.abbr }
  606.         { organization.field field.used =
  607.             { "The " #4 organization chop.word #3 text.prefix$ }
  608.             { title.field field.used =
  609.                 { format.btitle }
  610.                 { key.field field.used =
  611.                     { key #3 text.prefix$ }
  612.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  613.                   if$
  614.                 }
  615.               if$
  616.             }
  617.           if$
  618.         }
  619.       if$
  620.     }
  621.   if$
  622. }
  623.  
  624. FUNCTION {output.bibitem}
  625. { newline$
  626.   "\harvarditem[" write$
  627.   make.abbr.label write$
  628.   "]{" write$
  629.   make.full.label write$
  630.   "}{" write$
  631.   list.year write$
  632.   "}{" write$
  633.   cite$ write$
  634.   "}" write$
  635.   newline$
  636.   ""
  637.   before.all 'output.state :=
  638. }
  639.  
  640. FUNCTION {list.label.output}
  641. { make.list.label " " * write$
  642. }
  643.  
  644. FUNCTION {article}
  645. { output.bibitem
  646.   list.label.output
  647.   " (" list.year * ")" * output.nonnull
  648.   author "author" item.check
  649.   title.field field.used =
  650.     { skip$ }
  651.     { format.title quote "title" output.check }
  652.   if$
  653.   crossref missing$
  654.     { journal emphasize "journal" duplicate$ item.check
  655.       pages empty$
  656.         {
  657.           output
  658.         }
  659.         {
  660.           " " *
  661.           format.vol.num.pages * output
  662.         }
  663.       if$
  664.     }
  665.     { format.article.crossref output.nonnull
  666.       format.pages output
  667.     }
  668.   if$
  669.   new.block
  670.   note output
  671.   fin.entry
  672. }
  673.  
  674. FUNCTION {book}
  675. { output.bibitem
  676.   list.label.output
  677.   " (" list.year * ")" * output.nonnull
  678.   author empty$
  679.     { editor "author and editor" item.check }
  680.     { crossref missing$
  681.     { "author and editor" editor either.or.check }
  682.     'skip$
  683.       if$
  684.     }
  685.   if$
  686.   title.field field.used =
  687.     { skip$ }
  688.     { format.btitle "title" output.check }
  689.   if$
  690.   crossref missing$
  691.     { format.bvolume output
  692.       format.number.series output
  693.       format.edition output
  694.       publisher "publisher" output.check
  695.       address output
  696.     }
  697.     { format.book.crossref output.nonnull
  698.       format.edition output
  699.     }
  700.   if$
  701.   new.block
  702.   note output
  703.   fin.entry
  704. }
  705.  
  706. FUNCTION {booklet}
  707. { output.bibitem
  708.   list.label.output
  709.   " (" list.year * ")" * output.nonnull
  710.   title.field field.used =
  711.     { skip$ }
  712.     { format.title quote "title" output.check }
  713.   if$
  714.   howpublished output
  715.   address output
  716.   new.block
  717.   note output
  718.   fin.entry
  719. }
  720.  
  721. FUNCTION {inbook}
  722. { output.bibitem
  723.   list.label.output
  724.   " (" list.year * ")" * output.nonnull
  725.   author empty$
  726.     { editor "author and editor" item.check }
  727.     { crossref missing$
  728.     { "author and editor" editor either.or.check }
  729.     'skip$
  730.       if$
  731.     }
  732.   if$
  733.   title.field field.used =
  734.     { skip$ }
  735.     { format.btitle "title" output.check }
  736.   if$
  737.   crossref missing$
  738.     { format.bvolume output
  739.       format.number.series output
  740.       format.edition output
  741.       publisher "publisher" output.check
  742.       address output
  743.     }
  744.     { format.book.crossref output.nonnull
  745.       format.edition output
  746.     }
  747.   if$
  748.   format.chapter.pages "chapter and pages" output.check
  749.   new.block
  750.   note output
  751.   fin.entry
  752. }
  753.  
  754. FUNCTION {incollection}
  755. { output.bibitem
  756.   list.label.output
  757.   " (" list.year * ")" * output.nonnull
  758.   title.field field.used =
  759.     { skip$ }
  760.     { format.title "title" output.check }
  761.   if$
  762.   author "author" item.check
  763.   crossref missing$
  764.     { format.in.ed.booktitle "booktitle" output.check
  765.       format.edition output
  766.       format.bvolume output
  767.       format.number.series output
  768.       publisher "publisher" output.check
  769.       address output
  770.     }
  771.     { format.incoll.inproc.crossref output.nonnull
  772.     }
  773.   if$
  774.   format.chapter.pages output
  775.   new.block
  776.   note output
  777.   fin.entry
  778. }
  779.  
  780. FUNCTION {inproceedings}
  781. { output.bibitem
  782.   list.label.output
  783.   " (" list.year * ")" * output.nonnull
  784.   title.field field.used =
  785.     { skip$ }
  786.     { format.title "title" output.check }
  787.   if$
  788.   author "author" item.check
  789.   crossref missing$
  790.     { format.in.ed.booktitle "booktitle" output.check
  791.       format.bvolume output
  792.       format.number.series output
  793.       address empty$
  794.     { organization output
  795.       publisher output
  796.     }
  797.     { organization output
  798.       publisher output
  799.           address output.nonnull
  800.      }
  801.       if$
  802.     }
  803.     { format.incoll.inproc.crossref output.nonnull
  804.     }
  805.   if$
  806.   format.pages output
  807.   new.block
  808.   note output
  809.   fin.entry
  810. }
  811.  
  812. FUNCTION {conference} { inproceedings }
  813.  
  814. FUNCTION {manual}
  815. { output.bibitem
  816.   list.label.output
  817.   " (" list.year * ")" * output.nonnull
  818.   title.field field.used =
  819.     { skip$ }
  820.     { format.btitle "title" output.check }
  821.   if$
  822.   format.edition output
  823.   author empty$
  824.     { organization empty$
  825.     { address output }
  826.     'skip$
  827.       if$
  828.     }
  829.     { organization output
  830.       address output
  831.     }
  832.   if$
  833.   new.block
  834.   note output
  835.   fin.entry
  836. }
  837.  
  838. FUNCTION {mastersthesis}
  839. { output.bibitem
  840.   list.label.output
  841.   " (" list.year * ")" * output.nonnull
  842.   author "author" item.check
  843.   title.field field.used =
  844.     { skip$ }
  845.     { format.title "title" output.check }
  846.   if$
  847.   "Master's thesis" format.thesis.type output.nonnull
  848.   school "school" output.check
  849.   address output
  850.   new.block
  851.   note output
  852.   fin.entry
  853. }
  854.  
  855. FUNCTION {misc}
  856. { output.bibitem
  857.   list.label.output
  858.   " (" list.year * ")" * output.nonnull
  859.   title.field field.used =
  860.     { skip$ }
  861.     { format.title quote output }
  862.   if$
  863.   howpublished output
  864.   new.block
  865.   note output
  866.   fin.entry
  867.   empty.misc.check
  868. }
  869.  
  870. FUNCTION {phdthesis}
  871. { output.bibitem
  872.   list.label.output
  873.   " (" list.year * ")" * output.nonnull
  874.   author "author" item.check
  875.   title.field field.used =
  876.     { skip$ }
  877.     { title "title" output.check }
  878.   if$
  879.   "PhD thesis" format.thesis.type output.nonnull
  880.   school "school" output.check
  881.   address output
  882.   new.block
  883.   note output
  884.   fin.entry
  885. }
  886.  
  887. FUNCTION {proceedings}
  888. { output.bibitem
  889.   list.label.output
  890.   " (" list.year * ")" * output.nonnull
  891.   title.field field.used =
  892.     { skip$ }
  893.     { format.btitle "title" output.check }
  894.   if$
  895.   format.bvolume output
  896.   format.number.series output
  897.   address empty$
  898.     { editor empty$
  899.     { skip$ }
  900.     { organization output
  901.     }
  902.       if$
  903.       publisher output
  904.     }
  905.     { editor empty$
  906.     'skip$
  907.     { organization output }
  908.       if$
  909.       publisher output
  910.       address output.nonnull
  911.     }
  912.   if$
  913.   new.block
  914.   note output
  915.   fin.entry
  916. }
  917.  
  918. FUNCTION {techreport}
  919. { output.bibitem
  920.   list.label.output
  921.   " (" list.year * ")" * output.nonnull
  922.   author "author" item.check
  923.   title.field field.used =
  924.     { skip$ }
  925.     { format.title "title" output.check }
  926.   if$
  927.   format.tr.number output.nonnull
  928.   institution "institution" output.check
  929.   address output
  930.   new.block
  931.   note output
  932.   fin.entry
  933. }
  934.  
  935. FUNCTION {unpublished}
  936. { output.bibitem
  937.   list.label.output
  938.   " (" list.year * ")" * output.nonnull
  939.   author "author" item.check
  940.   title.field field.used =
  941.     { skip$ }
  942.     { format.title "title" output.check }
  943.   if$
  944.   note "note" output.check
  945.   fin.entry
  946. }
  947.  
  948. FUNCTION {default.type} { misc }
  949.  
  950. MACRO {jan} {"January"}
  951.  
  952. MACRO {feb} {"February"}
  953.  
  954. MACRO {mar} {"March"}
  955.  
  956. MACRO {apr} {"April"}
  957.  
  958. MACRO {may} {"May"}
  959.  
  960. MACRO {jun} {"June"}
  961.  
  962. MACRO {jul} {"July"}
  963.  
  964. MACRO {aug} {"August"}
  965.  
  966. MACRO {sep} {"September"}
  967.  
  968. MACRO {oct} {"October"}
  969.  
  970. MACRO {nov} {"November"}
  971.  
  972. MACRO {dec} {"December"}
  973.  
  974. MACRO {acmcs} {"ACM Computing Surveys"}
  975.  
  976. MACRO {acta} {"Acta Informatica"}
  977.  
  978. MACRO {cacm} {"Communications of the ACM"}
  979.  
  980. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  981.  
  982. MACRO {ibmsj} {"IBM Systems Journal"}
  983.  
  984. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  985.  
  986. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  987.  
  988. MACRO {ieeetcad}
  989.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  990.  
  991. MACRO {ipl} {"Information Processing Letters"}
  992.  
  993. MACRO {jacm} {"Journal of the ACM"}
  994.  
  995. MACRO {jcss} {"Journal of Computer and System Sciences"}
  996.  
  997. MACRO {scp} {"Science of Computer Programming"}
  998.  
  999. MACRO {sicomp} {"SIAM Journal on Computing"}
  1000.  
  1001. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1002.  
  1003. MACRO {tods} {"ACM Transactions on Database Systems"}
  1004.  
  1005. MACRO {tog} {"ACM Transactions on Graphics"}
  1006.  
  1007. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1008.  
  1009. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1010.  
  1011. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1012.  
  1013. MACRO {tcs} {"Theoretical Computer Science"}
  1014.  
  1015. READ
  1016.  
  1017. EXECUTE {init.field.constants}
  1018.  
  1019. FUNCTION {sortify}
  1020. { purify$
  1021.   "l" change.case$
  1022. }
  1023.  
  1024. FUNCTION {author.key.label}
  1025. { author empty$
  1026.     { key empty$
  1027.     { title.field 'field.used := }
  1028.     { key.field 'field.used := }
  1029.       if$
  1030.     }
  1031.     { author.field 'field.used := }
  1032.   if$
  1033. }
  1034.  
  1035. FUNCTION {author.editor.key.label}
  1036. { author empty$
  1037.     { editor empty$
  1038.     { key empty$
  1039.         { title.field 'field.used := }
  1040.         { key.field 'field.used := }
  1041.       if$
  1042.       }
  1043.     { editor.field 'field.used := }
  1044.       if$
  1045.     }
  1046.     { author.field 'field.used := }
  1047.   if$
  1048. }
  1049.  
  1050. FUNCTION {author.key.organization.label}
  1051. { author empty$
  1052.     { key empty$
  1053.     { organization empty$
  1054.         { title.field 'field.used := }
  1055.         { organization.field 'field.used := }
  1056.       if$
  1057.     }
  1058.     { key.field 'field.used := }
  1059.       if$
  1060.     }
  1061.     { author.field 'field.used := }
  1062.   if$
  1063. }
  1064.  
  1065. FUNCTION {editor.key.organization.label}
  1066. { editor empty$
  1067.     { key empty$
  1068.     { organization empty$
  1069.         { title.field 'field.used := }
  1070.         { organization.field 'field.used := }
  1071.       if$
  1072.     }
  1073.     { key.field 'field.used := }
  1074.       if$
  1075.     }
  1076.     { editor.field 'field.used := }
  1077.   if$
  1078. }
  1079.  
  1080. FUNCTION {sort.format.title}
  1081. { 't :=
  1082.   "A " #2
  1083.     "An " #3
  1084.       "The " #4 t chop.word
  1085.     chop.word
  1086.   chop.word
  1087.   sortify
  1088.   #1 global.max$ substring$
  1089. }
  1090.  
  1091. FUNCTION {calc.label}
  1092. { type$ "book" =
  1093.   type$ "inbook" =
  1094.   or
  1095.     'author.editor.key.label
  1096.     { type$ "proceedings" =
  1097.     'editor.key.organization.label
  1098.     { type$ "manual" =
  1099.         'author.key.organization.label
  1100.         'author.key.label
  1101.       if$
  1102.     }
  1103.       if$
  1104.     }
  1105.   if$
  1106.   make.abbr.label
  1107.   title.field field.used =
  1108.     { sort.format.title }
  1109.     { sortify }
  1110.   if$
  1111.   year field.or.null purify$ #-1 #4 substring$ sortify
  1112.   *
  1113.   'sort.label :=
  1114. }
  1115.  
  1116. FUNCTION {first.presort}
  1117. { calc.label
  1118.   sort.label
  1119.   title.field field.used =
  1120.     { skip$ }
  1121.     { "    "
  1122.       *
  1123.       make.list.label sortify
  1124.       *
  1125.       "    "
  1126.       *
  1127.       title field.or.null
  1128.       sort.format.title
  1129.       *
  1130.     }
  1131.   if$
  1132.   #1 entry.max$ substring$
  1133.   'sort.key$ :=
  1134. }
  1135.  
  1136. ITERATE {first.presort}
  1137.  
  1138. SORT
  1139.  
  1140. STRINGS { last.sort.label next.extra }
  1141.  
  1142. INTEGERS { last.extra.num }
  1143.  
  1144. FUNCTION {initialize.last.extra.num}
  1145. { #0 int.to.chr$ 'last.sort.label :=
  1146.   "" 'next.extra :=
  1147.   #0 'last.extra.num :=
  1148. }
  1149.  
  1150. FUNCTION {forward.pass}
  1151. { last.sort.label sort.label =
  1152.     { last.extra.num #1 + 'last.extra.num :=
  1153.       last.extra.num int.to.chr$ 'extra.label :=
  1154.     }
  1155.     { "a" chr.to.int$ 'last.extra.num :=
  1156.       "" 'extra.label :=
  1157.       sort.label 'last.sort.label :=
  1158.     }
  1159.   if$
  1160. }
  1161.  
  1162. FUNCTION {reverse.pass}
  1163. { next.extra "b" =
  1164.     { "a" 'extra.label := }
  1165.     'skip$
  1166.   if$
  1167.   year empty$
  1168.     { "n.d." extra.label emphasize * 'list.year := }
  1169.     { year extra.label emphasize * 'list.year := }
  1170.   if$
  1171.   extra.label 'next.extra :=
  1172. }
  1173.  
  1174. EXECUTE {initialize.last.extra.num}
  1175.  
  1176. ITERATE {forward.pass}
  1177.  
  1178. REVERSE {reverse.pass}
  1179.  
  1180. FUNCTION {second.presort}
  1181. { make.list.label
  1182.   title.field field.used =
  1183.     { sort.format.title }
  1184.     { sortify }
  1185.   if$
  1186.   "    "
  1187.   *
  1188.   list.year field.or.null sortify
  1189.   *
  1190.   "    "
  1191.   *
  1192.   title.field field.used =
  1193.     { skip$ }
  1194.     { title field.or.null
  1195.       sort.format.title
  1196.       *
  1197.     }
  1198.   if$
  1199.   #1 entry.max$ substring$
  1200.   'sort.key$ :=
  1201. }
  1202.  
  1203. ITERATE {second.presort}
  1204.  
  1205. SORT
  1206.  
  1207. FUNCTION {begin.bib}
  1208. { preamble$ empty$
  1209.     'skip$
  1210.     { preamble$ write$ newline$ }
  1211.   if$
  1212.   "\begin{thebibliography}{xx}" write$ newline$
  1213. }
  1214.  
  1215. EXECUTE {begin.bib}
  1216.  
  1217. EXECUTE {init.state.consts}
  1218.  
  1219. ITERATE {call.type$}
  1220.  
  1221. FUNCTION {end.bib}
  1222. { newline$
  1223.   "\end{thebibliography}" write$ newline$
  1224. }
  1225.  
  1226. EXECUTE {end.bib}
  1227.